package com.yn.xr.middleware.news.service.impl;

import javax.annotation.Resource;

import com.yn.core.service.impl.BaseServiceImpl;
import com.yn.xr.middleware.news.service.NewsProveService;
import com.yn.xr.news.dao.NewsArticleApproveInfoDao;
import com.yn.xr.news.mode.NewsArticleApproveInfo;

public class NewsProveServiceImpl extends
		BaseServiceImpl<NewsArticleApproveInfo, Integer> implements
		NewsProveService {
	private static final long serialVersionUID = 4196267427132575739L;
	@Resource
	private NewsArticleApproveInfoDao newsProveDao;

	/**
	 * 新闻点赞插入
	 * 
	 * @param newsArticleApproveInfo
	 * @return
	 * @throws Exception
	 */
	@Override
	public void insertNewsProve(NewsArticleApproveInfo newsArticleApproveInfo)
			throws Exception {
		newsProveDao.save(newsArticleApproveInfo);
	}

	@Override
	public void updateNewsProve(NewsArticleApproveInfo newsArticleApproveInfo)
			throws Exception {
		newsProveDao.update(newsArticleApproveInfo);
	}

	@Override
	public NewsArticleApproveInfo findNewsProveBynewsId(int newsId)
			throws Exception {
		return newsProveDao.findById(newsId);
	}
}
